<template>
	<view class="order-detail">
		<navBar v-if="isShowCustomNavBar" :navbarData.sync="navbarData"></navBar>
		<loading :showLoaded.sync="showLoaded"></loading>
		<view class="itemStatus">
			<view class="position-text">
				{{ (obj.status == 'TRADE_FINISHED'&& orderItemsRefundStatus == 'Refunded') ? '已退款' : obj.status == 'WAIT_SELLER_SEND_GOODS' ? '支付成功' : (obj.status == "WAIT_BUYER_PAY" && obj.approveStatus == 0 && openAppointment) ? '待审核' : ((obj.status == "WAIT_BUYER_PAY" && obj.approveStatus == -1) || (obj.status == "TRADE_CLOSED_BY_CLOUD" && obj.approveStatus == -1) || (obj.status == "CLOSED" && obj.approveStatus == -1)) && openAppointment ? '预约申请未成功' : (obj.status == "WAIT_BUYER_PAY" && obj.approveStatus == 1 && openAppointment) ? '待提交订单并付款' : (obj.status == "BUYER_PART_PAYMENT" && obj.approveStatus == 1 && openAppointment || obj.status == "BUYER_PART_PAYMENT" && !openAppointment) ? '待支付' : orderStatusList[obj.status]}}
			</view>
			<image class="dividers_img"
				:src="obj.status == 'WAIT_SELLER_SEND_GOODS' || obj.status == 'WAIT_BUYER_CONFIRM_GOODS' || (obj.status == 'TRADE_FINISHED'&& orderItemsRefundStatus == 'Completed') ? dividersImgRed : dividersImg">
			</image>
			<view
				v-if="(obj.status == 'WAIT_BUYER_PAY' || obj.status == 'BUYER_PART_PAYMENT') && (openAppointment && obj.approveStatus == 1) && obj.cuttime > 0"
				style='margin-top:42rpx;'>
				<view style="font-size:28rpx;">
					距离购买资格失效还有
					<u-count-down color='#fff' style="margin: 0 10rpx;" height='40' separator-color='#000' bg-color='#000'
						:timestamp="obj.cuttime" :show-hours="true" font-size='26' @end='endCutdown'></u-count-down>
				</view>
				<view v-if="obj.status == 'WAIT_BUYER_PAY'" class="text2Line">
					请尽快提交订单并支付
				</view>
				<view v-else-if="obj.status == 'BUYER_PART_PAYMENT'" class="text2Line">
					请尽快完成付款
				</view>
			</view>
			<!-- 待支付 文案内容 -->
			<block
				v-else-if="(obj.status == 'WAIT_BUYER_PAY' || obj.status == 'BUYER_PART_PAYMENT') && !openAppointment && obj.cuttime > 0">
				<view class="text_75c">尊贵的麦卡伦贵宾</view>
				<view class="text_75c">
					请在
					<u-count-down color='#000' style="margin: 0 4px;font-family: FrankNew-Medium;" separator-color='#000' :colonPadding="true"
						bg-color='transparent' :timestamp="obj.cuttime" :show-hours="true" font-size='24'
						@end='endCutdown'></u-count-down>
					内完成支付
				</view>
			</block>
			<!-- 支付成功 文案内容 -->
			<block v-else-if="obj.status == 'WAIT_SELLER_SEND_GOODS'">
				<view class="text_75c">尊贵的麦卡伦贵宾</view>
				<view class="text_75c">
					您的订单{{obj.orderCode}}已支付成功
				</view>
				<view class="text_75c">
					将在系统确认后自动进入发货环节
				</view>
			</block>
			<!-- 待收货 文案内容 -->
			<block v-else-if="obj.status == 'WAIT_BUYER_CONFIRM_GOODS'">
				<view class="text_75c">尊贵的麦卡伦贵宾</view>
				<view class="text_75c">
					您的订单{{obj.orderCode}}已发货
				</view>
				<!-- <view class="text_75c" v-if="expressLists.length">
          快递单号是{{expressLists[0].trackingNumber}}
        </view> -->
			</block>
			<!-- 确认收货 已完成 文案内容 -->
			<block v-else-if="obj.status == 'TRADE_FINISHED' && orderItemsRefundStatus == 'Completed'">
				<view class="text_75c">尊贵的麦卡伦贵宾</view>
				<view class="text_75c">
					您的订单{{obj.orderCode}}已签收
				</view>
			</block>
			<!-- 已退款 文案内容 -->
			<block v-else-if="obj.status == 'TRADE_FINISHED' && orderItemsRefundStatus == 'Refunded'">
				<view class="text_75c">尊贵的麦卡伦贵宾</view>
				<view class="text_75c">
					您的订单{{obj.orderCode}}已经成功取消
				</view>
				<view class="text_75c">
					您支付款项已原路退回至您的付款账户
				</view>
			</block>
			<!-- 已关闭 文案内容 -->
			<block v-else-if="obj.status == 'TRADE_CLOSED_BY_CLOUD' || obj.status == 'CLOSED'">
				<view class="text_75c">尊贵的麦卡伦贵宾</view>
				<view class="text_75c">您的订单已超时，无法继续支付</view>
			</block>
			<!-- 已取消 文案内容 -->
			<block v-else-if="obj.status == 'TRADE_CLOSED'">
				<view class="text_75c">尊贵的麦卡伦贵宾，您的订单已取消</view>
			</block>
		</view>
		<!-- 分割线 -->
		<image class="line_img"
			src="https://100000063-1252208446.file.myqcloud.com/images/macallan-remvp/cart/empty_cart_line3x.png"></image>
		<!-- 订单详情 -->
		<view class="order_detail" v-if="!showLoaded">
			<view class="goods-box">
				<view class="info_block">
					<view class="item flex_space_between">
						<view class="flex_start">
							<text
								class="title">{{((obj.status == "WAIT_BUYER_PAY") || (obj.status == 'TRADE_CLOSED_BY_CLOUD') || (obj.approveStatus == -1 && obj.status == 'CLOSED') || ( obj.status == 'TRADE_CLOSED')) && !obj.addition.activitySelectionRecordId && !obj.addition.hasPrivateSaleSku && openAppointment ? '预约申请编号' : '订单编号'}}</text>
							<text class="content"
								@longpress="copy">{{(obj.status == 'WAIT_BUYER_PAY' || ( obj.status == 'TRADE_CLOSED_BY_CLOUD') || ( obj.approveStatus == 0 && obj.status == 'TRADE_CLOSED') || ( obj.status == 'TRADE_CLOSED')) && !obj.addition.activitySelectionRecordId && !obj.addition.hasPrivateSaleSku && openAppointment ? ("Y" + obj.orderCode) : obj.orderCode }}</text>
						</view>
						<view @click="handleCopyOrderId" class="copybtn_style">复制</view>
					</view>
					<view class="item flex_start">
						<text
							class="title item-title">{{((obj.status == "WAIT_BUYER_PAY") || (obj.status == 'TRADE_CLOSED_BY_CLOUD') || (obj.approveStatus == -1 && obj.status == 'CLOSED'))&& !obj.addition.activitySelectionRecordId && !obj.addition.hasPrivateSaleSku && openAppointment ? '预约申请时间' : '下单时间'}}</text>
						<text class="content content3">{{ obj.orderTime }}</text>
					</view>
					<!-- <view class="item" v-if="obj.payStatus == 1">
            <text class="title">付款时间：</text>
            <text class="content">{{ obj.payedTime }}</text>
          </view> -->
				</view>
				<view class="goods_block">
					<!-- <view class="title">订单商品</view> -->
					<block v-for="(item, index) in list" :key="index">
						<view class="good_list" v-if="item.isGift != 1">
							<view @click='jumpPdp(item)' class="image_boxs">
								<image :src="item.skuImageUrl"></image>
							</view>
							<view class="textInfo">
								<view @click='jumpPdp(item)'>
									<strong>{{ item.itemName }}</strong>
									<view class="product_info">
										<view class="price">{{ item.skuProperties[0].valueName }}</view>
										<view class="goods_num">
											{{ item.qty }}x
											<text class="other_text_mark">￥</text>
											{{filterChecked.moneyFormat(item.divideOrderFee/1, 2)}}
										</view>
									</view>
								</view>
							</view>
						</view>
					</block>
				</view>
				
				<view v-if="userC2bOrder" class="user_c2b_order">
					<view class="title">含个性化定制服务</view>
					<view @click="handleCustomizationDetails" class="copybtn2_style">查看镌刻</view>
				</view>
				<view class="footer">
					<view class="money">
						<text class="money_name">订单金额</text>
						<text class="receive_money">
							<text class="mark">¥</text>
							{{ obj.payment / 1 ? filterChecked.moneyFormat(obj.payment, 2) : '' }}
						</text>
					</view>
				</view>
			</view>
			<!-- 温馨提示 -->
			<!-- <view class="remind-text" v-if="((obj.status == 'WAIT_BUYER_PAY' && obj.approveStatus !== 1) || (obj.status == 'TRADE_CLOSED_BY_CLOUD' && obj.approveStatus == -1) || (obj.status == 'CLOSED' && obj.approveStatus == -1)) && openAppointment">
        <image class="remind-img" src="https://100000063-1252208446.file.myqcloud.com/images/macallan-remvp/order/info_icon.png"></image>
        <view class="remind-inner">
          温馨提示：预约并非下单。如经系统审核，该预约申请存在异常或预约商品出现库存不足等情形时，则预约申请可能不成功，从而不能进入下单环节。相关政策详见
          <text @click.stop="shoppingInstructions" class="check-dec">《THE MACALLAN麦卡伦线上精品店购物须知》</text>或咨询在线客服。
        </view>
      </view> -->
			<view class="remind-text"
				v-if="(obj.status == 'TRADE_FINISHED'&& orderItemsRefundStatus == 'Completed') || (showStatusTypes.includes(obj.status) && !openAppointment && obj.cuttime > 0)">
				<image class="remind-img"
					src="https://100000063-1252208446.file.myqcloud.com/images/macallan-remvp/order/info_icon.png"></image>
				<view class="remind-inner">
					如经系统确认，该订单构成异常订单，我们有权采取不予发货、取消订单或其他合理措施，并为您办理退款手续。相关政策详见
					<text @click.stop="shoppingInstructions" class="check-dec">《THE MACALLAN麦卡伦线上精品店购物须知》</text>或
					<text class="check-dec">咨询在线客服。</text>
				</view>
			</view>
			<!-- 收货地址信息 -->
			<view class="address_block"
				v-if="showStatusTypes.includes(obj.status) || (obj.status == 'TRADE_FINISHED'&& orderItemsRefundStatus == 'Completed')">
				<image class="location_iconimg" :src="locationIconImg"></image>
				<view class="info_box">
					<view class="title" style="padding-top: 4rpx;margin-bottom: 24rpx;">配送信息</view>
					<view class="user_info">
						<view style="margin-bottom: 20rpx;">
							{{ obj.receiverName }}
							<text class="mobile">{{ obj.receiverMobile }}</text>
						</view>
						<view v-if="!showSale && obj.status == 'WAIT_SELLER_SEND_GOODS'" class="copybtn_style">
							<!-- 修改地址 -->
							<navigator hover-class="none"
								:url="'/pages/customer/address?type=reSet&orderNo=' + obj.orderCode+'&no='+orderNo">
								<view>修改地址</view>
							</navigator>
						</view>
					</view>
					<view class="city" style="margin-bottom: 8rpx;">
						{{ obj.receiverState }}&nbsp;{{ obj.receiverCity }}&nbsp;{{ obj.receiverDistrict }}
					</view>
					<view class="city_details">
						<text v-if="obj.receiverTown">{{ obj.receiverTown }}&nbsp;</text>
						{{ obj.receiverAddress }}
					</view>
					<block v-if="expressLists.length">
						<view class="express_box flex_space_between" v-for="(item, index) in expressLists" :key="index">
							<view class="express_info">快递单号<text style="margin-left: 16rpx;">{{item.trackingNumber}}</text></view>
							<view :data-id="obj.orderId" @click="handleCheckExpress" class="copybtn_style">查看物流</view>
						</view>
					</block>
				</view>
			</view>
		</view>
		<view class="bottom_btnbox">
			<view v-if="obj.orderSource == 'mall'" class="mall-tip">如需操作订单请登录至官网(www.cosstores.cn)</view>
			<view class="bottom_btn_group" v-if="obj.orderSource == 'wxapp'">
				<!-- TS订单是待支付时可以修改地址 -->
				<!-- <view  class="btn btn_del" v-if="!showSale && (obj.status == 'BUYER_PART_PAYMENT' && obj.approveStatus == 1 && openAppointment || obj.status == 'BUYER_PART_PAYMENT' && !openAppointment)"> -->
				<view class="btn btn_del"
					v-if="!showSale && (obj.status == 'WAIT_BUYER_PAY'||obj.status == 'BUYER_PART_PAYMENT')">
					<navigator hover-class="none"
						:url="'/pages/customer/address?type=reSet&orderNo=' + obj.orderCode+'&no='+orderNo">
						<view>修改地址</view>
					</navigator>
				</view>
				<button open-type="contact" show-message-card="true" size="20" class="btn btn_del"
					style="margin-right: 0;padding: 0;">
					在线客服
				</button>
				<view class="btn btn_del" @click="handleToHomePage" v-if="showHomeBtnTypes.includes(obj.status)">前往首页</view>
				<block
					v-if="obj.status == 'TRADE_FINISHED' && orderItemsRefundStatus == 'Completed' && obj.shipTime!==null && invoiceAmount>0">
					<view class="btn btn_del"
						v-if="(obj.invoiceType == 0 && applyLists.includes(obj.invoiceStatus)) || (obj.invoiceType == 1 && obj.invoiceStatus == 5)"
						@click="applyInvoice(obj)">
						<view>申请发票</view>
					</view>
				</block>
				<view class="btn btn_del" v-if="obj.status == 'TRADE_FINISHED' && lookLists.includes(obj.invoiceStatus)">
					<navigator hover-class="none" :url="'/pages/invoice/list?orderNo=' + obj.orderId">
						<view>查看发票</view>
					</navigator>
				</view>
				<!-- <view v-if="isAllowApplyRefund > 0" class="btn btn_del" @click="refundGoods" :data-id="obj.orderId" :data-refund="obj.refundStatus">申请退货</view> -->
				<!-- 未发货仅退款 -->
				<view class="btn btn_del dsh" @click="completion"
					v-if="obj.status === 'WAIT_BUYER_CONFIRM_GOODS' && isAllowConfirm > 0" :data-ordercode="obj.orderCode">
					确认收货</view>
				<view class="btn btn_del" @click="cancelOrder"
					v-if="obj.status === 'WAIT_BUYER_PAY' && obj.approveStatus !== -1 && openAppointment || (obj.status === 'BUYER_PART_PAYMENT' && obj.approveStatus !== -1 && openAppointment)"
					:data-id="obj.orderId" :data-ordercode="obj.orderCode">
					{{obj.addition.activitySelectionRecordId || obj.addition.hasPrivateSaleSku || !openAppointment ?'取消订单':'取消预约申请'}}
				</view>
				<view class="btn type_pick dsh" @click="payMoney"
					v-if="obj.status === 'WAIT_BUYER_PAY' && obj.approveStatus == 1 && openAppointment" :data-id="obj.orderId"
					:data-ordercode="obj.orderCode">提交订单并付款</view>
				<view class="btn type_pick dsh" @click="payMoney"
					v-else-if="obj.status === 'WAIT_BUYER_PAY' && !openAppointment" :data-id="obj.orderId"
					:data-ordercode="obj.orderCode">再次支付</view>
				<view class="btn type_pick dsh" @click="payMoney"
					v-else-if="obj.status === 'BUYER_PART_PAYMENT' && (!openAppointment || (openAppointment && obj.approveStatus == 1))"
					:data-id="obj.orderId" :data-ordercode="obj.orderCode">继续付款</view>
			</view>
		</view>
		<!-- 弱提示 弹窗 -->
		<toast-popup ref="toastPopup" @onToastPopupClick="onToastPopupClick"></toast-popup>
		<!-- 个性化定制内容查看 -->
		<c2bDetails ref="c2bDetailsPopup"></c2bDetails>
	</view>
</template>
<script module="filterChecked" lang="wxs" src="../../utils/filter.wxs"></script>
<script>
	import tip from '@/utils/tip';
	import api from '@/api/api';
	import NavBar from '../../components/common/navbar';
	import Loading from '../../components/common/loading';
	import c2bDetails from './components/c2bDetails';
	
	import {
		SYSTEM_INFO,
		CUSTOMER_INFO,
		MERCHANT_INFO,
		USER_SPECICAL_INFO
	} from '@/utils/constant';
	export default {
		data() {
			return {
				showStatusTypes: ['WAIT_SELLER_SEND_GOODS', 'WAIT_BUYER_CONFIRM_GOODS'], // 温馨提示/快递单号 展示
				showHomeBtnTypes: ['TRADE_CLOSED', 'TRADE_CLOSED_BY_CLOUD', 'WAIT_SELLER_SEND_GOODS', 'WAIT_BUYER_CONFIRM_GOODS',
					'TRADE_FINISHED'
				], //前往首页按钮展示
				invoiceAmount: 0,
				isShowCustomNavBar: true,
				navbarData: {
					showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
					navbarTitle: '订单详情', //导航栏 中间的标题
					hideSearch: true,
					hideHome: false
				},
				openAppointment: this.$programSetting.openAppointment,
				showLoaded: true,
				showModal: false,
				isAllowApplyRefund: '', //是否允许申请退货
				isAllowConfirm: '', //是否允许确认收货
				previousPages: '',
				itemLength: '',
				router: '',
				obj: {},
				orderNo: '',
				list: [],
				refundItems: [], // 仅退款的items参数
				refundOrderList: [],
				refundLists: [],
				itemQty: 0, // 订单商品总数
				orderStatusList: {
					WAIT_BUYER_PAY: '待支付',
					BUYER_PART_PAYMENT: '待支付',
					// BUYER_PART_PAYMENT: '付款中',
					WAIT_SELLER_SEND_GOODS: '待发货',
					WAIT_BUYER_CONFIRM_GOODS: '待收货',
					TRADE_FINISHED: '已完成',
					TRADE_CLOSED: '已取消',
					TRADE_CLOSED_BY_CLOUD: '已关闭',
					RETAIL_STORE_RECEIVED: '门店已收货',
					DC_RECEIVED: '仓库已收货'
				},
				/**
				 * 退款状态可选值 WAIT_SELLER_AGREE(买家已经申请退款，等待卖家同意)
				                WAIT_BUYER_RETURN_GOODS(卖家已经同意退款，等待买家退货)
				                WAIT_SELLER_CONFIRM_GOODS(买家已经退货，等待卖家确认收货)
				                CLOSED(退款关闭)
				                SUCCESS(退款成功)
				                RETAIL_STORE_RECEIVED(门店已收货)
				                DC_RECEIVED(仓库已收货)
				 */
				reorderStatus: {
					WAIT_SELLER_AGREE: '待审核',
					WAIT_BUYER_RETURN_GOODS: '待退货',
					WAIT_SELLER_CONFIRM_GOODS: '待退款',
					SUCCESS: '退款成功',
					CLOSED: '已关闭',
					RETAIL_STORE_RECEIVED: '门店已收货',
					DC_RECEIVED: '仓库已收货'
				},
				refundStatus: [],
				filterClose: [],
				orderExpress: {},
				expressFlowInfo: {},
				payType: '',
				subscribeMessage: [],
				giftName: '',
				discountsArr: [],
				isRefundIndex: -1,
				windowHeight: 0,
				imageHeight: 120,
				cancelTime: '',
				showMergeEvaluation: false,
				onlyFreight: false,
				identifier: 'cms/itemrecommend',
				identifiers: 'cms/webview2',
				nowPages: '',
				orderPaymentTypeArr: {
					alipay_payment: '支付宝',
					wxpay_payment: '微信支付',
					wechat_pay: '微信支付',
					weixin: '微信支付',
					alipay: '支付宝',
					unionpay: '银联',
					'wosai:weixin:mini': '微信小程序',
					'wosai:alipay:wap': '支付宝',
					'wosai:weixin:wap': '微信',
					'wosai:weixin:mini:giftcard': '礼品卡'
				},
				checkOrderId: '',
				btnActive: true,
				touchStartTime: '',
				tsActId: '',
				preview: false,
				locationIconImg: "",
				dividersImg: "",
				dividersImgRed: "",
				expressLists: [],
				orderItemsRefundStatus: "", //  Completed已完成 /Refunded 已退款
				lookLists: [2, 3, 5], //  发票状态为 2,3,5 展示查看发票按钮
				applyLists: [0, 1, 4], //  发票状态为 0,1,4 展示申请发票按钮
				showSale: false,
				userC2bOrder: false,	//	是否是c2b订单
				userCustomizationDetails: null
			};
		},
		components: {
			loading: Loading,
			navBar: NavBar,
			c2bDetails: c2bDetails
		},
		onHide() {
			this.showLoaded = true;
		},
		onLoad: async function(options) {
			await this.$onLaunched;
			let that = this;
			this.imageHeight = 120 / uni.getStorageSync('imageScaling');
			this.orderNo = options.orderNo;
			let pages = getCurrentPages();
			let prevpage = pages[pages.length - 2];
			var currPage = pages[pages.length - 1]; //当前页面
			this.nowPages = currPage.route;
			if (prevpage == undefined) {
				this.previousPages = '';
			} else {
				this.previousPages = prevpage.route ? prevpage.route : '';
			}
			this.cancelTime = getApp().globalData.cancelTime * 60;

			const {
				locationSvgImg,
				paySuccessIconSvgImg
			} = require('./imgs.svg.js');
			this.locationIconImg = locationSvgImg('#000');
			this.dividersImg = paySuccessIconSvgImg("#000");
			this.dividersImgRed = paySuccessIconSvgImg("#CB171A");
		},
		onShow: async function() {
			this.showLoaded = true
			await this.$onLaunched;
			this.btnActive = true
			let pages = getCurrentPages();
			let prevPage = pages[pages.length - 2]
			if (!!prevPage) {
				prevPage.$vm.backSuccess = true;
			}
			let that = this;
			await that.getOrderInfo();
			if (!!this.checkOrderId) {
				this.refreshOrderInfo()
			}
			if (this.obj.cuttime) {
				let systemInfo = uni.getStorageSync(SYSTEM_INFO);
				let isIos = systemInfo.system.indexOf('iOS')
				// json.header['x-cloud-server-timestamp']
				that.$commonFunction.getServerTime().then((nowTime) => {
					if (!!this.obj.planEndTime) {
						if (isIos == 0) {
							this.obj.cuttime = (new Date(this.obj.planEndTime.replace(/-/g, '/')).getTime() - nowTime) / 1000
						} else {
							this.obj.cuttime = (new Date(this.obj.planEndTime).getTime() - nowTime) / 1000
						}
					} else {
						if (!!this.obj.approveTime) {
							if (isIos == 0) {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.approveTime.replace(/-/g, '/'))
									.getTime()) / 1000
							} else {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.approveTime).getTime()) / 1000
							}
						} else {
							if (isIos == 0) {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.createTime.replace(/-/g, '/'))
									.getTime()) / 1000
							} else {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.createTime).getTime()) / 1000
							}
						}
					}
					setTimeout(() => {
						that.showLoaded = false
					}, 400);
				})

			} else {
				this.showLoaded = false
			}
			getApp().cl_tracker.track('mini_program_view', {
				path: this.nowPages,
				pageName: '订单详情',
			})
			setTimeout(() => {
				that.$commonSensors.orderDetailPageView(this.obj)
			}, 4000)
		},
		onUnload() {
			if (this.previousPages == 'pages/return/applySuccess' || this.previousPages == 'pages/return/details' || this
				.previousPages == 'pages/return/return' || this.previousPages == 'pages/order/reLogistics') {
				uni.redirectTo({
					url: '/pages/order/list'
				});
			}
		},
		methods: {
			handleCustomizationDetails(){
				if(!this.userCustomizationDetails || !this.userCustomizationDetails.customizationImg) return this.handleShowTextToast('定制信息回显异常');
				this.$refs.c2bDetailsPopup.show(this.userCustomizationDetails);
			},
			/**
			 * 展示弱提示
			 * @param {Object} msg 文案
			 */
			handleShowTextToast(msg){
				try{
					this.$refs.toastPopup.showToast(msg);
				}catch(e){}
			},
			/**
			 * 若提示按钮点击回调
			 * @param {Object} data.type 类型：confirm确定，cancel取消
			 * @param {Object} data.callBackData 呼气弹窗时传入的数据
			 */
			onToastPopupClick(data){
				const {type,callBackData} = data;
				if(callBackData && callBackData.type){
					//	取消订单确认
					if(callBackData.type === "requestCancelOrder"){
						if(type === 'confirm'){
							this.requestCancelOrder()
						}else{
							this.btnActive = true
						}
					}
					//	确认收货提示弹窗
					if(type === 'confirm' && callBackData.type === "handleAjaxConfirmOrder"){
						this.handleAjaxConfirmOrder(callBackData.data);
					}
				}
				
			},
			jumpPdp(item) {
				let tsOrderInfo = {}
				tsOrderInfo.isTsDraw = this.obj?.addition?.tsActivityLimitList?.[0]?.hasLimitPurchase ? true : false
				tsOrderInfo.tsName = this.obj?.addition?.forwardPurchaseActivityList?.[0]?.forwardPurchaseActivityName || ''
				tsOrderInfo.tsActId = this.tsActId
				let params = encodeURIComponent(JSON.stringify(tsOrderInfo))
				uni.navigateTo({
					url: `/pages/item/item?id=${item.itemId}&valueId=${item.skuProperties?.[0].valueId}&valueName=${item.skuProperties?.[0].valueName}&tsActId=${this.tsActId}&tsOrderInfo=${params}`
				})
			},

			skipSale() {
				let {
					listPath
				} = uni.getStorageSync('TsInfo')
				uni.reLaunch({
					url: listPath
				})
				// this.trackClickBar()
			},
			trackClickBar() {
				let {
					tsActId,
					name
				} = uni.getStorageSync('TsInfo');
				let params = {
					"c_pageName": "商品详情页",
					"c_campaignID": tsActId,
					"c_campaignName": name
				}
				getApp().commonClTrack('c_ebmp_home_member_campaign_click_bar', params);
			},
			async refreshOrderInfo() {
				let that = this
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO)
				const json = await api.getOrderInfo({
						header: {
							jwt: customerInfo.jwt
						}
					},
					this.checkOrderId
				);
				if (json.code === 1000) {
					if (json.data.status == 'WAIT_SELLER_SEND_GOODS') {
						uni.redirectTo({
							url: '/pages/order/paySuccess?orderNo=' + this.checkOrderId
						});
						this.checkOrderId = ''
					} else {
						setTimeout(() => {
							that.showLoaded = false
						}, 400);
					}
				} else {
					setTimeout(() => {
						that.showLoaded = false
					}, 400);
				}
			},

			async applyInvoice(item) {
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO)
				const amount = await api.getwosaiInvoiceAmount({
						header: {
							jwt: customerInfo.jwt
						}
					},
					item.orderId
				);
				if (amount.code === 1000) {
					let invoiceAmount = amount.data.invoiceAmount;
					uni.navigateTo({
						url: '/pages/invoice/apply?orderNo=' + item.orderId
					});
				}
			},
			endCutdown() {
				this.getOrderInfo();
			},
			// 计算开发票金额
			wosaiInvoiceAmount: async function() {
				let that = this;
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
				const amount = await api.getwosaiInvoiceAmount({
						header: {
							jwt: customerInfo.jwt
						}
					},
					this.orderNo
				);
				if (amount.code === 1000) {
					that.invoiceAmount = amount.data.invoiceAmount;
				}
			},
			// 购物须知
			shoppingInstructions() {
				uni.navigateTo({
					url: '/pages/utcms/utcms?uttype=shoppingInstructions'
				})
			},

			// 倒计时
			flashSale() {
				let that = this
				that.$commonFunction.getServerTime().then((nowTime) => {
					let starttime = new Date(that.obj.orderTime).getTime()
					let differenceTime = nowTime + 30 * 60 * 1000 - starttime
					let timeDifference = new Date(differenceTime)
				})
			},

			getGoodsStatus: async function() {
				let that = this;
				let merchantInfo = uni.getStorageSync("merchantInfo") || getApp().globalData.merchantInfo
				let customerInfo = uni.getStorageSync("customerInfo") || getApp().globalData.customerInfo
				const goodsEvaluateStateJson = await api.orderGoodsEvaluateState({
					header: {
						jwt: customerInfo.jwt
					},
					query: {
						orderId: that.obj.orderId,
						storeId: merchantInfo.cloudMerchantStoreId
					}
				})
				if (goodsEvaluateStateJson.code == 1000) {
					that.showMergeEvaluation = goodsEvaluateStateJson.data[that.obj.orderCode] == 1 ? true : false
					that.list.forEach(function(item, index, array) {
						item.itemReviewStatus = goodsEvaluateStateJson.data[item.skuCode]
						that.$forceUpdate()
					})
				}
			},
			// 根据订单号查询详情
			getOrderInfo: async function() {
				let that = this;
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO)
				//判断是否可以确认收货 0 - 不可以， 1- 可以
				const ConfirmJudge = await api.isAllowConfirm({
						header: {
							jwt: customerInfo.jwt
						}
					},
					this.orderNo
				);
				if (ConfirmJudge.code == 1000) {
					this.isAllowConfirm = ConfirmJudge.data.isAllow;
				}

				//判断是否可以申请退货 0 - 不可以， 1- 可以
				const applyJudge = await api.isAllowapplyRefund({
						header: {
							jwt: customerInfo.jwt
						}
					},
					this.orderNo
				);
				if (applyJudge.code == 1000) {
					this.isAllowApplyRefund = applyJudge.data.isAllow;
				}

				const json = await api.getOrderInfoWithTime({
						header: {
							jwt: customerInfo.jwt
						}
					},
					this.orderNo
				);
				if (json.data.code === 1000) {
					this.obj = json.data.data;
					//	判断是否是c2b订单
					if(this.obj.addition && this.obj.addition.customization && this.obj.addition.customizationImg){
						this.userC2bOrder = true;
						this.userCustomizationDetails = {
							customization: this.obj.addition.customization,
							customizationImg: this.obj.addition.customizationImg
						}
					}else{
						this.userC2bOrder = false;
						this.userCustomizationDetails = null;
					}
					//判断抽签购商品
					if (this.obj.addition && this.obj.addition.activitySelectionId) {
						this.showSale = true
					}
					// 判断是否为TS订单
					// if (!!uni.getStorageSync('TsInfo') && json.data.data.addition && json.data.data.addition.hasPrivateSaleSku) {
					//   this.$commonFunction.getTsByUser().then((res) => {
					//     this.showSale = res;
					//   })
					// }
					if (json.data.data.addition && json.data.data.addition.hasPrivateSaleSku) {
						this.tsActId = this.obj.addition.forwardPurchaseActivityList?.[0].forwardPurchaseActivityId
					}
					let notGiftNum = 0;
					let notGiftTotalNum = 0;
					this.obj.items.forEach(innerItem => {
						if (innerItem.isGift == 0) {
							notGiftNum += innerItem.qty
							notGiftTotalNum += innerItem.qty
						}
					});

					if (this.obj.status == "TRADE_FINISHED") {
						if (this.obj.refundStatus == 'NO_REFUND') {
							this.orderItemsRefundStatus = 'Completed';
						} else {
							// 查找已触发退款的商品
							let refundArr = this.obj.items.filter(item => item.refundStatus != "NO_REFUND");
							//  Completed已完成 /Refunded 已退款
							this.orderItemsRefundStatus = refundArr.length === this.obj.items.length ? 'Refunded' : 'Completed';
						}
					}

					this.obj.notGiftNum = notGiftNum
					this.obj.notGiftTotalNum = notGiftTotalNum
					if (this.openAppointment && (json.data.data.status == "WAIT_BUYER_PAY" || json.data.data.status ==
							'TRADE_CLOSED_BY_CLOUD' || json.data.data.approveStatus == -1) && !json.data.data.addition
						.activitySelectionRecordId && !json.data.data.addition.hasPrivateSaleSku) {
						this.navbarData.navbarTitle = "预约申请详情"
					}
					that.flashSale()
					this.getGoodsStatus()
					let systemInfo = uni.getStorageSync(SYSTEM_INFO);
					let isIos = systemInfo.system.indexOf('iOS')
					let nowTime = json.header['x-cloud-server-timestamp']
					if (!!this.obj.planEndTime) {
						if (isIos == 0) {
							this.obj.cuttime = (new Date(this.obj.planEndTime.replace(/-/g, '/')).getTime() - nowTime) / 1000
						} else {
							this.obj.cuttime = (new Date(this.obj.planEndTime).getTime() - nowTime) / 1000
						}
					} else {
						if (!!this.obj.approveTime) {
							if (isIos == 0) {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.approveTime.replace(/-/g,
									'/')).getTime()) / 1000
							} else {
								this.obj.cuttime = (new Date(this.obj.planEndTime).getTime() - nowTime) / 1000
							}
						} else {
							if (isIos == 0) {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.createTime.replace(/-/g, '/'))
									.getTime()) / 1000
							} else {
								this.obj.cuttime = this.cancelTime - (nowTime - new Date(this.obj.createTime).getTime()) / 1000
							}
						}
					}

					that.orderSource = this.obj.orderSource;
					that.payType = this.obj.payType;
					let merchantInfo = uni.getStorageSync("merchantInfo") || getApp().globalData.merchantInfo;
					that.list = await this.getOrderItemHDImg(json.data.data.items, merchantInfo);
					//  查询快递单号
					if (this.showStatusTypes.includes(this.obj.status) || (this.obj.status == 'TRADE_FINISHED' && this
							.orderItemsRefundStatus == 'Completed')) this.getShipmentList(this.obj.orderId);
					that.wosaiInvoiceAmount()
					let orderItemIdArr = [];
					let discountsArr = [];
					//解析每个数组下面的items.skuProperties属性
					that.list.forEach(function(item, index, array) {
						that.list[index].skuProperties = JSON.parse(array[index].skuProperties);
						// 赠品名称
						if (that.list[index].isGift == 1) {
							that.giftName = that.list[index].itemName;
						}

						// 促销
						if (that.list[index].discounts && that.list[index].discounts.length > 0) {
							for (let j = 0; j < that.list[index].discounts.length; j++) {
								if (discountsArr.indexOf(that.list[index].discounts[j].discountName) == -1) {
									discountsArr.push(that.list[index].discounts[j].discountName);
								}
							}
						}

						if (orderItemIdArr.indexOf(that.list[index].orderItemId) == -1) {
							orderItemIdArr.push({
								num: that.list[index].qty,
								orderItemId: that.list[index].orderItemId,
								reason: '未发货取消订单'
							});
						}
					});

					that.discountsArr = discountsArr;
					if (that.discountsArr.length == 1) {
						that.discountsArr?.[0].indexOf('运费') !== -1
						that.onlyFreight = true
					} else {
						that.onlyFreight = false
					}
					that.refundItems = orderItemIdArr;
					that.itemLength = that.list.length;
					setTimeout(() => {
						that.showLoaded = false
					}, 400);
					that.getRefundOrderStatus();
				} else {
					setTimeout(() => {
						that.showLoaded = false
					}, 400);
					this.handleShowTextToast(json.data.data.msg);
				}
			},

			getRefundOrderStatus: async function() {
				let that = this;
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO)
				for (let k in that.list) {
					const refundOrderJson = await api.getRefundListByOrderItemId({
							header: {
								jwt: customerInfo.jwt
							}
						},
						that.list[k].orderItemId
					);

					that.list[k].refundOrderItems = [];
					that.list[k].refundRemoveJson = [];
					if (refundOrderJson.code === 1000) {
						that.refundLists = refundOrderJson.data;
						if (that.refundLists.length > 0) {
							// that.refundOrderList = this.unique(that.refundOrderList)
							that.list[k].refundRemoveJson = that.refundLists;

							// 去掉已关闭的订单状态
							for (let z in that.list[k].refundRemoveJson) {
								let K_listRefund = that.list[k].refundRemoveJson[z];
								if (K_listRefund.status !== 'CLOSED') {
									that.list[k].refundOrderItems.push(K_listRefund);
								}
							}
						}
					}
				}
				setTimeout(() => {
					that.showLoaded = false;
				}, 400);
			},

			// 去重
			unique: function(arr) {
				for (var i = 0; i < arr.length; i++) {
					for (var j = i + 1; j < arr.length; j++) {
						if (arr[i].refundId == arr[j].refundId) {
							//第一个等同于第二个，splice方法删除第二个
							arr.splice(j, 1);
							j--;
						}
					}
				}
				return arr;
			},

			// 点击退货详情
			showRefundStatus(e) {
				let index = e.currentTarget.dataset.index;
				if (index == this.isRefundIndex) {
					this.isRefundIndex = -1;
				} else {
					this.isRefundIndex = e.currentTarget.dataset.index;
				}
			},

			// 获取模板ID
			getTmplIds: async function() {
				let merchantInfo = uni.getStorageSync(MERCHANT_INFO)
				const tmplIds = await api.customize({
					method: 'POST',
					query: {
						cloudMerchantId: merchantInfo.cloudMerchantId,
						cloudMerchantStoreId: merchantInfo.cloudMerchantStoreId,
						cloudStoreConfigtypeId: 59,
						cloudStoreConfigtypeName: 'Mini_Subscribe_Message_Config'
					}
				});
				if (tmplIds.code == 200) {
					const configText = tmplIds.data.cloudStoreConfigText;
					let configTextParse = JSON.parse(configText);
					let orderMessage = [];
					if (configTextParse.paymentMsg == 1) {
						orderMessage.push(configTextParse.paymentTemplateId);
					}
					if (configTextParse.shipmentMsg == 1) {
						orderMessage.push(configTextParse.shipmentTemplateId);
					}
					if (configTextParse.applyRefundMsg == 1) {
						orderMessage.push(configTextParse.applyRefundTemplateId);
					}
					this.subscribeMessage = orderMessage;
				}
			},
			//下拉刷新
			onPullDownRefresh() {
				this.getOrderInfo();
				uni.stopPullDownRefresh();
			},
			/**
			 * 复制订单编号
			 * @param {Object} e
			 */
			handleCopyOrderId(e) {
				var that = this;
				uni.setClipboardData({
					// data: this.obj.orderCode,
					data: ((this.obj.status == 'WAIT_BUYER_PAY') || (this.obj.status == 'TRADE_CLOSED_BY_CLOUD') || (this.obj
							.approveStatus == 0 && this.obj.status == 'TRADE_CLOSED') || (this.obj.status == 'TRADE_CLOSED')) && !
						this.obj.addition.activitySelectionRecordId && !this.obj.addition.hasPrivateSaleSku && this
						.$programSetting.openAppointment ? ("Y" + this.obj.orderCode) : this.obj.orderCode,
					success: function(res) {
						that.handleShowTextToast('复制成功')
					}
				});
			},
			/**
			 * 查看物流
			 * @param {Object} e
			 */
			handleCheckExpress(e) {
				this.orderNo = e.currentTarget.dataset.id;
				uni.navigateTo({
					url: '/pages/order/logistics?orderNo=' + this.orderNo
				});
			},
			// 退货状态查看详情
			goRma(e) {
				this.isRefundIndex = -1;
				this.orderNo = e.target.dataset.id;
				this.refundId = e.target.dataset.refundid;
				if (this.refundId == undefined) {
					return;
				}
				uni.navigateTo({
					url: '/pages/return/details?refundId=' + this.refundId + '&orderNo=' + this.orderNo
				});
			},

			// 支付但未发货 申请退款
			refundMoney: async function(e) {
				let that = this;
				let status = e.currentTarget.dataset.status;
				let refund = e.currentTarget.dataset.refund;
				if (this.obj.addition.activitySelectionRecordId || !this.$programSetting.openAppointment) {
					await tip.confirm('是否取消订单');
				} else {
					await tip.confirm('是否取消预约');
				}
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO)

				const json = await api.refundApply({
					method: 'POST',
					header: {
						jwt: customerInfo.jwt
					},
					query: {
						goodStatus: 'BUYER_RECEIVED',
						hasGoodsReturn: 0,
						orderId: this.orderNo,
						items: this.refundItems,
						reason: encodeURI('未发货取消订单'),
						refundFee: this.obj.itemTotal
					}
				});
				if (json.code === 1000) {
					this.applyReturnMoney = 0;
					this.handleShowTextToast('申请退款成功');
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/order/list'
						});
					}, 2000);
				} else {
					await this.handleShowTextToast('申请失败');
				}
			},
			async refundApply() {},

			// 支付已发货 申请退货
			refundGoods: async function(e) {
				this.orderNo = e.currentTarget.dataset.id;
				uni.navigateTo({
					url: '/pages/return/return?orderNo=' + this.orderNo
				});
			},

			// 未付款时取消订单
			cancelOrder: async function(e) {
				if ((e.timeStamp - this.touchStartTime) < 1000 || !this.btnActive) {
					return false
				}
				this.touchStartTime = e.timeStamp;
				this.btnActive = false
				let that = this;
				this.orderNo = e.currentTarget.dataset.id;
				let status = e.currentTarget.dataset.status;
				let sale = e.currentTarget.dataset.sale;
				let draw = e.currentTarget.dataset.draw;
				let orderFlow = this.$programSetting.openAppointment;
				let objOrderType = this.$commonFunction.isOrderType(this.obj, orderFlow);
				this.$commonFunction.trackOrder(this.obj, objOrderType, 'c_ebmp_order_cancel');
				if (this.obj.addition.activitySelectionRecordId || this.obj.addition.hasPrivateSaleSku || !this
					.$programSetting.openAppointment) {
					// await tip.confirm('是否取消订单').then(() => {
					// 	this.requestCancelOrder()
					// }).catch(() => {
					// 	this.btnActive = true
					// });
					this.$refs.toastPopup.showPopup({
						msg:"是否取消订单",
						callBackData: {
							type: "requestCancelOrder",
						}})
				} else {
					// await tip.confirm('是否取消预约').then(() => {
					// 	this.requestCancelOrder()
					// }).catch(() => {
					// 	this.btnActive = true
					// });
					this.$refs.toastPopup.showPopup({
						msg:"是否取消订单",
						callBackData: {
							type: "requestCancelOrder",
						}})
				}

			},
			async requestCancelOrder() {
				let jwt = uni.getStorageSync(CUSTOMER_INFO).jwt
				let that = this;
				let json = await api.cancelOrder({
						method: 'PUT',
						header: {
							jwt: jwt
						},
						query: {}
					},
					this.orderNo
				);
				if (json.code === 1000) {
					this.btnActive = true;
					var timestamp = new Date().getTime();
					that.$sr.track('custom_order', {
						order: {
							order_id: that.obj.orderCode.toString(),
							order_time: new Date(that.obj.orderTime.replace(/-/g, "/")).getTime() || new Date(that.obj
								.orderTime).getTime(),
							order_status: 'cancel_give_order'
						},
						sub_orders: [{
							sub_order_id: that.obj.orderCode.toString(),
							order_amt: parseFloat(that.obj.itemTotal),
							pay_amt: parseFloat(that.obj.payment)
						}]
						// more...
					});
					this.handleShowTextToast('订单取消成功');
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/order/list'
						});
					}, 2000);
					that.$commonSensors.commonCancelOrder(that.obj)
				} else {
					this.btnActive = true;
					// this.handleShowTextToast(json.msg);
				}
			},
			// 确认收货
			completion: async function(e) {
				let that = this;
				let orderCode = e.currentTarget.dataset.ordercode;
				
				if (!orderCode) {
					return false;
				}
				// await tip.confirm('是否确认收货');
				this.$refs.toastPopup.showPopup({
					msg:"是否确认收货",
					callBackData: {
						type: "handleAjaxConfirmOrder",
						data: orderCode
					}})
			},
			//	发送确认收货请求
			async handleAjaxConfirmOrder(orderCode){
				let jwt = uni.getStorageSync(CUSTOMER_INFO).jwt;
				let json = await api.submitOrder({
						method: 'PUT',
						header: {
							jwt: jwt
						},
						query: {}
					},
					orderCode
				);
				if (json.code === 1000) {
					this.handleShowTextToast('确认收货成功');
					uni.navigateBack({
						delta: -1
					})
				} else {
					this.handleShowTextToast(json.msg);
				}
			},
			getSqbToken(orderCode) {
				return new Promise(async (resolve, reject) => {
					let that = this
					let subject = "微信小程序支付"
					let customerInfo = uni.getStorageSync(CUSTOMER_INFO)
					const getTokenJson = await api.getSqbToken({
						method: "POST",
						header: {
							jwt: customerInfo.jwt,
						},
						query: {
							"outTradeNo": orderCode,
							"subject": subject,
						}
					});
					if (getTokenJson.code === 1000) {
						resolve(getTokenJson)
					} else {
						reject(getTokenJson)
					}
				})
			},
			// 未支付 去付款
			payMoney: async function(e) {
				if (((e.timeStamp - this.touchStartTime) < 1000) || !this.btnActive) {
					return false
				}
				let that = this
				that.btnActive = false
				this.checkOrderId = that.obj.orderId;
				this.touchStartTime = e.timeStamp
				let orderFlow = this.$programSetting.openAppointment;
				let objOrder = this.$commonFunction.isOrderType(this.obj, orderFlow);
				that.$commonFunction.payMoney(this.obj, this, objOrder).then((res) => {
					that.btnActive = true
				}).catch((err) => {
					that.btnActive = true
				})
			},
			/**
			 * 查询快递单号
			 * @param {Object} orderNo
			 */
			async getShipmentList(orderNo) {
				this.expressLists = [];
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
				const json = await api.getShipmentList({
						header: {
							jwt: customerInfo.jwt
						},
						query: {}
					},
					this.orderNo
				);
				if (json && json.code === 1000 && json.data) {
					for (let i = 0; i < json.data.length; i++) {
						this.expressLists.push({
							expressCode: json.data[i].expressCode,
							expressName: json.data[i].expressName,
							trackingNumber: json.data[i].trackingNumber
						})
					}
				}
			},
			// 跳转首页
			handleToHomePage() {
				uni.reLaunch({
					url: '/pages/home/home'
				});
			},
			/**
			 * 查询订单商品的高清大图
			 * @param {Object} lists
			 * @param {Object} merchantInfo
			 */
			async getOrderItemHDImg(lists, merchantInfo) {
				const that = this;
				let _lists = JSON.parse(JSON.stringify(lists));
				if (_lists && _lists.length) {
					for (let i = 0; i < _lists.length; i++) {
						const el = _lists[i];
						if (el.extendParameters && el.extendParameters.hdlpImageUrl) {
							el.skuImageUrl = el.extendParameters.hdlpImageUrl;
						} else {
							// 订单未返回高清大图内容，调用商品详情查询
							const _goodsRes = await that.getDetailsById(merchantInfo, el.itemId)
							if (_goodsRes) el.skuImageUrl = _goodsRes;
						}
					}
				}
				return _lists;
			},
			/**
			 * 获取商品详情
			 * @param {Object} merchantInfo
			 * @param {Object} itemId
			 */
			async getDetailsById(merchantInfo, itemId) {
				return new Promise(async (resolve, reject) => {
					const _res = await api.goodsDetail({
							query: {
								merchant_id: merchantInfo.cloudMerchantId,
								store_id: merchantInfo.cloudMerchantStoreId
							}
						},
						itemId
					);
					let _img = "";
					if (_res && _res.code == 1000 && _res.data && _res.data.resources && _res.data.resources.length) {
						const _obj = _res.data.resources.find((item) => item.kind == "hdlp");
						if (_obj && _obj.kind == "hdlp" && _obj.type == "image" && _obj.url) _img = _obj.url;
					}
					resolve(_img)
				})
			},
		}
	};
</script>
<style lang="less">
	.ts-entrance {
		background: #000;
		color: #fff;
		font-size: 31rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 410rpx;
		height: 88rpx;
		margin: 52rpx auto 65rpx;
	}

	.order-detail {
		background: #fff;
		padding-bottom: 146rpx;
	}

	.u-countdown-item {
		border-radius: 0 !important;
	}

	.order_detail {
		position: relative;
		margin: 0 48rpx;
	}

	.order_state {
		padding: 35rpx 24rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 10rpx;
		background: #fff;

		.iconfont {
			font-size: 40rpx;
			color: #6a6a6a;
		}

		.state_time {
			padding-top: 24rpx;
		}

		.center {
			flex: 1;
			margin-left: 50rpx;
		}

		.right {
			display: flex;
			align-items: center;
		}

		.unpaid {
			margin-left: 50rpx;

			.unpaid_doc {
				margin-left: 10rpx;
			}
		}

		.time_doc {
			font-size: 26rpx;
			color: #999;
		}

		.time_num {
			font-size: 26rpx;
			margin-right: 50rpx;
		}
	}

	.address_block {
		padding-top: 24rpx;
		padding-bottom: 88rpx;
		background: #fff;
		border-top: 1px solid #f2f2f2;
		display: flex;
		align-items: flex-start;
		justify-content: flex-start;

		.location_iconimg {
			width: 48rpx;
			height: 48rpx;
			flex-shrink: 0;
		}

		.info_box {
			width: 100%;
		}

		.title,
		.user_info,
		.mobile,
		.city,
		.city_details,
		.express_info {
			font-size: 24rpx;
			font-weight: 500;
			line-height: 40rpx;
		}

		.title,
		.user_info {
			font-family: FrankNew-Medium,NotoSansSC-Medium;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.user_info {
			.mobile {
				margin-left: 24rpx;
				font-family: FrankNew-Regular;
			}
		}

		.city,
		.city_details,
		.express_info {
			color: #757575;
			font-family: NotoSansSC-Regular, FrankNew-Regular, ;
		}

		.express_box {
			margin-top: 32rpx;
		}

		.address {
			padding-top: 20rpx;
		}

		.consignee {
			width: 140rpx;
			display: inline-block;
			text-align: right;
		}
	}

	// .goods_block {
	//   background: #fafafa;
	// }

	.goods_block .title {
		padding: 30rpx 20rpx 0;
	}

	.good_list {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		position: relative;
		margin-bottom: 16rpx;
		background: #fafafa;
	}

	.good_list:last-child {
		margin-bottom: 48rpx !important;
	}

	.info_block {
		margin-bottom: 32rpx;

		.item {
			height: 70rpx;

			.title,
			.content {
				line-height: 40rpx;
				font-size: 24rpx;
				color: #000;
				font-weight: normal;
			}

			.title {
				font-family: NotoSansSC-Regular;
				margin-right: 16rpx;
			}

			.content {
				font-family: FrankNew-Regular;
			}
		}

		.item:first-child {
			padding: 0;
		}
	}

	.image_boxs {
		width: 192rpx;
		height: 256rpx;
		flex-shrink: 0;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.content2 {
		line-height: 42rpx;
	}

	.footer {
		background: #fff;
		width: 100%;
		padding-bottom: 30rpx;
		text-align: right;
		overflow: hidden;

		.money {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.money_name {
				color: #1a1a1a;
				font-family: NotoSansSC-Medium;
				font-size: 28rpx;
				font-weight: 500;
				line-height: 48rpx;
			}
		}

		.receive_money {
			font-family: FrankNew-Medium;
			font-size: 28rpx;
			font-weight: 500;
			line-height: 48rpx;

			.mark {
				font-family: NotoSansSC-Medium !important;
				margin-right: 2px;
			}
		}
	}

	.bottom_btn_group {
		display: flex;
		align-items: flex-end;
		justify-content: flex-end;

		// margin-top: 168rpx;
		// padding-bottom: 40rpx;
		.btn {
			border: 1px solid #CB171A;
			text-align: center;
			width: 176rpx;
			height: 80rpx;
			line-height: 72rpx;
			border-radius: 48rpx 16rpx 48rpx 48rpx;
			font-family: NotoSansSC-Medium;
			font-size: 28rpx;
		}

		.btn_del {
			color: #000;
			border: 2px solid #000;
			background-color: #fff;
			margin-left: 16rpx;
		}

		.dsh {
			margin-left: 16rpx;
		}
	}

	.vLogistics {
		text-align: center;
		width: 120rpx;
		// margin-left: 135rpx;
		text-decoration: underline;
		margin: 0 auto;
	}

	.recInfo {
		padding-bottom: 20rpx;
	}

	.itemStatus {
		text-align: center;
		width: 100%;
		// height: 464rpx;
		padding: 0 48rpx 88rpx 48rpx;
		margin-top: 48px;
	}

	.copybtn_style {
		border-bottom: 1px solid #000;
		padding-bottom: 6rpx;
		font-family: NotoSansSC-Regular;
		font-size: 24rpx;
		font-weight: 500;
		color: #000;
		line-height: 32rpx;
	}

	.position-a {
		// position: absolute;
		// right: 16rpx;
		// top: 0;
	}

	.mall-tip {
		margin-right: 20rpx;
		margin-top: 168rpx;
	}

	.product_name {
		color: #414141;
		font-size: 32rpx;
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		word-break: break-all;
	}

	.product_rule {
		font-size: 26rpx;
		color: #757575;
		padding-top: 16rpx;
		display: none;
	}

	.product_info .price {
		color: #757575;
	}

	.goods {
		padding: 0;
		float: right;

		.order_footer {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding-top: 20rpx;
		}

		.order_state {
			color: #ff4856;
			font-size: 32rpx;
		}

		.btn_group {
			display: flex;
			align-items: right;

			.btn {
				font-size: 25rpx;
				padding: 10rpx 10rpx;
				text-align: center;
				margin: 0 auto;
				width: 100%;
			}

			.btn_del {
				color: #333;
				border: 1px solid #ccc;
			}
		}
	}

	.cost_price {
		padding-left: 20rpx;
	}

	.textInfo {
		width: 100%;
		padding-right: 32rpx;
	}

	.textInfo strong {
		font-family: NotoSansSC-Regular;
		font-size: 24rpx;
		font-weight: normal;
		display: block;
		width: 100%;
		line-height: 40rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2; // 控制多行的行数
		-webkit-box-orient: vertical;
	}

	.textInfo p {
		height: 40rpx;
		line-height: 40rpx;
		display: block;
		font-size: 26rpx;
	}

	.product_info {
		margin-top: 2px;
	}

	.product_info .price,
	.product_info .goods_num {
		font-size: 24rpx;
		font-weight: normal;
		line-height: 40rpx;
		font-family: FrankNew-Regular;
	}

	.product_info .goods_num {
		color: #000;
		margin-top: 16rpx;
	}

	.other_text_mark {
		font-family: NotoSansSC-Regular !important;
		margin-left: 4px;
		margin-right: 2px;
	}

	.rma_state {
		height: 36rpx;
		line-height: 46rpx;
		display: flex;
		justify-content: space-between;
		width: 100%;

		span {
			margin-left: 5px;
			text-decoration: underline;
		}
	}

	.stateTitem {
		font-size: 26rpx;
		color: #000;
		padding: 0 40rpx 0 10rpx;
	}

	.empty-box {
		padding-left: 14rpx;
	}

	.cartTotal {
		margin-top: 40rpx;
		padding: 20rpx 35rpx;
	}

	.cartTotal .item {
		display: flex;
		justify-content: space-between;
		margin-bottom: 20rpx;
		color: #000;
	}

	// 促销
	.discountItem {
		display: flex;
		justify-content: space-between;
		padding-bottom: 20rpx;

		.discounts-arr-box {
			max-width: 270px;
		}

		.discounts-item {
			display: block;
			text-align: right;
		}

		.discounts-item:last-child {
			padding-right: 0;
			border-right: 1px solid transparent;
		}
	}

	.evaluateBtn {
		display: inline-block;
		text-decoration: underline;
	}

	.evaluateBtnSingle {
		position: absolute;
		right: 9rpx;
		bottom: 18rpx;
		border: 2rpx solid #ccc;
		padding: 4rpx 10rpx 2rpx;

	}

	.pay_success_top {
		margin: 50px 10px;
		text-align: center;
	}

	.pay_success_top_p2 {
		margin: 30rpx 0;
	}

	.item-title {
		text-align: right;
	}

	.position-text {
		font-family: NotoSansSC-Medium;
		font-size: 64rpx;
		font-weight: 500;
		line-height: 80rpx;
		text-align: center;
	}

	.dividers_img {
		width: 143.22rpx;
		height: 40rpx;
		margin: 40rpx auto;
	}

	.remind-text {
		padding-top: 24rpx;
		margin-bottom: 32rpx;
		display: flex;
		align-items: flex-start;
		justify-content: flex-start;
		border-top: 1px solid #f2f2f2;

		.remind-img {
			width: 40rpx;
			height: 40rpx;
			flex-shrink: 0;
			margin-right: 4px;
		}
	}

	.check-dec {
		font-family: FrankNew-Medium, NotoSansSC-Medium;
		color: #000000;
	}

	.text2 {
		font-size: 28rpx;
		margin-right: 2rpx;
	}

	.remind-inner {
		font-size: 24rpx;
		font-family: FrankNew-Regular, NotoSansSC-Regular;
		font-weight: 500;
		line-height: 40rpx;
		color: #757575;
	}

	.text2Line {
		text-align: center;
		font-size: 28rpx;
		margin-top: 6rpx;
	}

	.flex_space_between {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.flex_start {
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}

	.text_75c {
		font-family: NotoSansSC-Regular;
		font-size: 24rpx;
		font-weight: 500;
		line-height: 40rpx;
		color: #757575;
	}

	.line_img {
		width: 750rpx;
		height: 12rpx;
		margin-bottom: 64rpx;
	}

	.bottom_btnbox {
		position: fixed;
		left: 0;
		bottom: 0;
		background-color: #fff;
		z-index: 999;
		width: 100%;
		// height: 208rpx;
		padding: 16rpx 48rpx 60rpx 48rpx;
	}
	.user_c2b_order{
		width: 100%;
		height: 88rpx;
		border-bottom: 1px solid #f2f2f2;
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		margin: 48rpx 0;
		.title{
			font-family: NotoSansSC-Medium;
			color: #000;
			font-size: 28rpx;
			font-weight: 500;
			line-height: 54rpx;
		}
		.copybtn2_style{
			height: 50rpx;
			line-height: 50rpx;
			border-bottom: 1px solid #000;
			font-family: NotoSansSC-Regular;
			font-size: 24rpx;
			font-weight: 500;
			color: #000;
		}
	}
</style>